/**
 *	(C) 2014 Yuanjj
 *
 *	define thread manager class
 *
 *	histroy
 * 		2014-08-07	yuanjj	- create the file
 */

#ifndef _THREAD_H_
#define _THREAD_H_

#include "typedef.h"
#include "errorcode.h"
#include "db_thread/db_thread.h"
#include "net_thread/net_thread.h"
#include "ui_thread/ui_thread.h"

enum
{
    TH_DB,
    TH_NET,
    TH_UI,
    TH_ALL
};

class cls_thread
{
public:
    cls_thread();
    ~cls_thread();

protected:
    base_thread		*m_threads[TH_ALL];
    db_thread		m_db_thread;
    net_thread		m_net_thread;
    ui_thread		m_ui_thread;

public:
    /**
     *	initialize the thread objects
     */
    pem_error_t		instance();

    /**
     *	release the thread objects
     */
    pem_void_t		release();
};

#endif // _THREAD_H_
